<?php
/* @var $this SiteController */

$this->pageTitle = Yii::app()->name;
?>


<!--<h4 class="title-job"></h4>-->
<header class="HeadProducts">
    <?= $lang == "en"?'Latest job':'ตำแหน่งงานล่าสุด' ?>
</header>
<div class="viewmore"><a href="index.php?lang=<?= $lang ?>&r=Jobs/List">View more</a></div>
<div style="clear:both;border-bottom:2px solid #ea0f34;width:100%;"></div>
<p>                           
<ul class="nav nav-tabs" id="tabZone">
    <li><a href="#bkk" data-toggle="tab"><?= $lang == 'en'?'Bangkok':'กรุงเทพ' ?></a></li>
    <li><a href="#provincial" data-toggle="tab"><?= $lang == 'en'?'Provincial':'ต่างจังหวัด' ?></a></li>
</ul>

<div class="tab-content">
    <div id="bkk" class="tab-pane fade" >
        <?php
        foreach ($JobsBKK as $row) { ?>
        <table class="table table-condensed">
            <thead>
                <tr><th colspan="2">
            <?= JobsManage::isNewsJob($row['CreateDate'])?GM::GetLabelsNew():'' ?>
            <?= $row['Position'] ?></th>
               <th colspan="2"><span class="label">Job ID : <?= $row['JobID'] ?></span></th></tr>
            </thead>
            <tbody>
                <tr class="">
                    <th class="rowheader span3">Location:</th><td class="span4"><?= $row['ProvinceName'] ?></td>
                    <th class="rowheader span3">Gender:</th><td class="span4"><?= $row['Sex'] == 'M'?'Male':($row['Sex'] == 'F'?'Female':'Undefined') ?></td></tr>
                <tr>
                    <th class="rowheader">Salary:</th><td><?= $row['Salary'] != ''?$row['Salary']:'-' ?> <?= $lang == 'en'?'bath':'บาท' ?></td>
                    <th class="rowheader">Age:</th><td><?= $row['Age'] != ''?$row['Age']:'-' ?> <?= $lang == 'en'?'year':'ปี' ?></td>
                </tr>
                <tr>
                    <th class="rowheader">Experience:</th><td><?= $row['Exp'] != ''?$row['Exp']:'-' ?> <?= $lang == 'en'?'year':'ปี' ?></td>
                    <th class=""></th>
                    <td style="text-align: right !important">
                        <a href="index.php?lang=<?= $lang ?>&r=Jobs/Detail&id=<?=$row['JobID']?>" class="btn" style="">
                    <i class="icon-list-alt"></i> Detail
                </a></td>
                </tr> 
            </tbody>
        </table>
        <hr/>
        <?php } ?>
    </div>
    <div id="provincial" class="tab-pane fade">
        <?php
        foreach ($JobsProvincial as $row) { ?>
        <table class="table table-condensed">
            <thead>
                <tr><th colspan="2">
            <?= JobsManage::isNewsJob($row['CreateDate'])?GM::GetLabelsNew():'' ?>
            <?= $row['Position'] ?></th>
               <th colspan="2"><span class="label">Job ID : <?= $row['JobID'] ?></span></th></tr>
            </thead>
            <tbody>
                <tr>
                    <th class="rowheader span3">Location:</th><td class="span4"><?= $row['ProvinceName'] ?></td>
                    <th class="rowheader span3">Gender:</th><td class="span4"><?= $row['Sex'] == 'M'?'Male':($row['Sex'] == 'F'?'Female':'Undefined') ?></td></tr>
                <tr>
                    <th class="rowheader">Salary:</th><td><?= $row['Salary'] != ''?$row['Salary']:'-' ?> <?= $lang == 'en'?'bath':'บาท' ?></td>
                    <th class="rowheader">Age:</th><td><?= $row['Age'] != ''?$row['Age']:'-' ?> <?= $lang == 'en'?'year':'ปี' ?></td>
                </tr>
                <tr>
                    <th class="rowheader">Experience:</th><td><?= $row['Exp'] != ''?$row['Exp']:'-' ?> <?= $lang == 'en'?'year':'ปี' ?></td>
                    <th class=""></th>
                    <td style="text-align: right !important">
                        <a href="index.php?lang=<?= $lang ?>&r=Jobs/Detail&id=<?=$row['JobID']?>" class="btn" style="">
                    <i class="icon-list-alt"></i> Detail
                </a></td>
                </tr> 
            </tbody>
        </table>
        <hr/>
        <?php } ?>
    </div>
</div>                          
</p>
<script src="scripts/carousel/jquery.carouFredSel-6.2.0-packed.js" type="text/javascript"></script>
<script type="text/javascript">
    $('#list_photos').carouFredSel({
        responsive: true,
        width: '100%',
        scroll: 2,
        items: {
            width: 320,
            visible: {
                min: 2,
                max: 6
            }
        }
    });
</script>
<script src="scripts/camera/scripts/camera.min.js" type="text/javascript"></script>
<script src="scripts/easing/jquery.easing.1.3.js" type="text/javascript"></script>
<script type="text/javascript">
    $(function(){
        startCamera();
        $('td').each(function(){
            if($(this).text()==''){
                $(this).text('-');
            }
        });
        $('#tabZone a[href="#bkk"]').tab("show");
    });
    function startCamera() {
        $('#camera_wrap').camera({
            fx: 'random',
            time: 3000,
            loader: 'none',
            playPause: false,
            navigation: true,
            height: '35%',
            pagination: true
        });
    }
</script>
<style>
    .tab-content td{
        /*width: 75%*/
    }
</style>